

package com.grt192.controller.GRTBenchTest;

import com.grt192.core.EventController;
import com.grt192.event.component.EncoderEvent;
import com.grt192.event.component.EncoderListener;
import com.grt192.mechansim.GRTBenchTest.EncodTestMechanism;
import com.grt192.sensor.GRTEncoder;

/**
 *
 * @author student
 *
 * Testing Encoder stuff
 */
public class EncodTestController extends EventController 
        implements EncoderListener {

    private EncodTestMechanism encodtester;

   public EncodTestController(GRTEncoder encod, EncodTestMechanism encodtester){
       this.encodtester = encodtester;
   }

    public void countDidChange(EncoderEvent e) {
        if(e.getSource().getId().equals("TestEncoder")){
            System.out.println(encodtester.getDistance());
        }
    }

    public void rotationDidStart(EncoderEvent e) {
    }

    public void rotationDidStop(EncoderEvent e) {
    }

    public void changedDirection(EncoderEvent e) {
    }


}
